// 封装一个函数：获取一个结果，当前时间是属于上午 下午 还是晚上
export const getTime = () => {
  let message = "";
  let now = new Date();
  let hours = now.getHours();
  if (hours < 9) {
    message = "早上";
  } else if (hours >= 9 && hours < 12) {
    message = "上午";
  } else if (hours >= 12 && hours < 13) {
    message = "中午";
  } else if (hours >= 13 && hours < 18) {
    message = "下午";
  } else {
    message = "晚上";
  }
  return message;
};
